# (8)
# 版本1
# def recommend_hobby():
#     # 数据
#     peiQi_hobby = {"螺狮粉", "臭豆腐", "榴莲", "apple"}
#
#     alex_hobby = {"螺狮粉", "臭豆腐", "榴莲", "💩", "pizza"}
#
#     yuan_hobby = {"pizza", "salad", "ice cream", "臭豆腐", "榴莲"}
#
#     hobby_list = [peiQi_hobby, yuan_hobby, alex_hobby]
#
#     hobby_list.remove(peiQi_hobby)
#
#     peiQi_recommend_hobby_set = set()
#     # print(type(peiQi_recommend_set))
#     for hobby in hobby_list:
#         if len(peiQi_hobby.intersection(hobby)) >= 2:
#             peiQi_recommend_hobby_set.update(hobby - peiQi_hobby)
#
#     return list(peiQi_recommend_hobby_set)
# print(recommend_hobby())

# 版本2
# def recommend_hobby(name):
#     # 数据
#
#     hobby_dict = {
#         "yuan": {"pizza", "salad", "ice cream", "臭豆腐", "榴莲"},
#         "alex": {"螺狮粉", "臭豆腐", "榴莲", "💩", "pizza"},
#         "peiQi": {"螺狮粉", "臭豆腐", "榴莲", "apple"},
#     }
#     # current_base_hobby = hobby_dict.get(name)
#     # 删除当前推荐人的hobby_set
#     current_base_hobby = hobby_dict.pop(name)
#     print("current_base_hobby", current_base_hobby)
#
#     current_recommend_hobby_set = set()
#
#     for name, hobby_set in hobby_dict.items():
#         if len(current_base_hobby.intersection(hobby_set)) >= 2:
#             current_recommend_hobby_set.update(hobby_set - current_base_hobby)
#
#     return list(current_recommend_hobby_set)
#
#
# print(recommend_hobby("alex"))
